import React,{Component} from 'react'
import cate_shop from '../../data/category'
import {NavLink} from 'react-router-dom'
export default class NewsIn extends Component{
    constructor(props){
        super(props)
        this.state={
            list:cate_shop
        }
    }
    componentWillMount(){
        let arr = this.state.list
        arr = arr.slice(10,14)
        this.setState({
            list:arr
        })
    }
    render(){
        return(
            <div>
                <h2>News In 新品资讯</h2>
                <div className="every_shop">
                    {
                        this.state.list.map((v,i)=>{
                            return(
                                <div key={i}>
                                    <NavLink to="newsDetail">
                                        <p>{v.name}</p>
                                        <img src={v.url}/>
                                    </NavLink>
                                   
                                </div>
                            )
                        })
                    }
                </div>
            </div>
        )
    }
}